#ifndef CNOTEINFOPANEL_H
#define CNOTEINFOPANEL_H

#include <MWidget>
#include <MLabel>
#include <MImageWidget>
#include <MButton>
#include <MLayout>
#include <MGridLayoutPolicy>
#include "QvernoteAPI.h"
#include "ui/MClickableImage.h"
#include "CAnimationManager.h"

#define INFO_LINE_HEIGHT    30

class CNoteInfoPanel : public MWidget
{
public:
    CNoteInfoPanel(QGraphicsItem* parent = 0);

    QSizeF sizeHint ( Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const;
    void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
    void showEvent( QShowEvent * event);
    void mousePressEvent(QGraphicsSceneMouseEvent* e);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent* e);
    void swipeGestureEvent (QGestureEvent *event, QSwipeGesture *gesture);
    //void panGestureEvent (QGestureEvent *event, QPanGesture *gesture);
    void setNote(Note& note);

    void animHide();
    void animShow();

private:
    void removeContent();
    void setupUI();

private:
    QvernoteAPI*    m_hEvernote;
    MClickableImage lFavorite;
    MLabel          lNoteTitle;
    MLabel          lNotebookName;
    MImageWidget    lTagIcon;
    MLabel          lLastTransparentLine;
    MLabel          lNoteTags;

    // TODO: Find the Icon and replace MButton with MImageWidget
    MButton         noteInfoHandle;
    MClickableImage     ciEmail;
    MClickableImage     ciMap;
    MLayout*            noteInfoPanelLayout;
    MGridLayoutPolicy*  noteInfoPanelLayoutPolicy;
    QPropertyAnimation* panelAnim;
    QPropertyAnimation* handleAnim;
    CAnimationManager   animationManager;
    bool                isExpanded;
    bool                mousePressed;
};

#endif // CNOTEINFOPANEL_H
